<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo F('web_page_title', false, V('g:skinset', false)? L('index__default__skinSetTitle') : false);?></title>
<?php TPL::plugin('include/css_link');?>
<?php
if(trim(V('g:skinset')) == 1):
?>
<link href="<?php echo W_BASE_URL ?>css/default/skin_set.css" rel="stylesheet" type="text/css" />
<?php
endif;
?>
<?php TPL::plugin('include/js_link');?>
</head>
<body id="home" class="own">
	<?php 
		if(trim(V('g:skinset')) == 1) {
			Xpipe::pagelet('common.userSkin');
		}
	?>
	<div id="wrap">
		<div class="wrap-in">
			<!-- 头部 开始-->
			<?php TPL::plugin('include/header');?>
            <!-- 头部 结束-->
			<div id="container">
				<div class="extra">
					<!-- 站点导航 开始 -->
					<?php Xpipe::pagelet('common.siteNav'); ?>
					<!-- 站点导航 结束 -->
				</div>
				<div class="content">
					<div class="main-wrap">
                        <div class="main">
                            <div class="main-bd">
                            <!-- 折扣微博搜索开始 -->
                            	<form name="wbnamesrh" id="wbnamesrh" action="/index.php">
                            	<div class="gt_search_sbmt"><a href="#"  id="wbsrhbtn" class="btn-s2"><span>找折扣微博</span></a></div>
                            	<div class="gt_search">    
                            	<input type="hidden" name="m" value="srhrecmduser"/>                        	
                            	<input class="gt_search_text" name="wbname" type="text"/>                            	
                            	</div>
                            	
                            	</form>
                            		<script type="text/javascript">
							  $("#wbsrhbtn").click(function(){
								         
								  $("#wbnamesrh").submit();
							       
							    });						       
							
							</script>
                            	<!-- 折扣微博搜索结束 -->
                                <!-- 微博发布框 开始-->
								
								<div class="opera-area">
			<span class="opera-area-r">
			<a href="#" rel="e:sd,format:-1" class="ico-post-weibo"><?php LO('modules__userHead__pubWeibo');?></a>
			</span>
		</div>
                                <!-- 微博发布框 结束-->
                                <!-- 微博列表 开始-->                	
                                
				<?php if (empty($list) && empty($filter_type)):?>
					<!-- 初始化页面 -->
					<div class="index-default">
					<?php if (V('g:page', 1) > 1):?>
						<div class="default-tips">
							<div class="icon-tips"></div>
							<p><?php LO('index__default__endPageTip');?></p>
						</div>
					<?php else:?>
						<div class="default-tips">
							<div class="icon-tips"></div>
							<p><?php LO('index__default__emptyWeiboTip');?></p>
							<p><?php LO('index__default__showMoreWeiboTip', URL('search.recommend'), "javascript:$('#publish_box textarea').focus(),void(0);");?></p>
						</div>
						<?php Xpipe::pagelet('user.hotUser'); ?>
						<?php endif;?>
					</div>
					<!-- end 初始化页面 -->
				<?php
					else:
						//聚焦位
						$fc = DS('Plugins.get', 'g1/86400', 2);

						// 手动关闭后有cookie['fc_ad']
						if (false) {//mod by gt 不显示首页的聚焦
						//if ($fc['in_use'] && !isset($_COOKIE['fc_ad'])) {
							$ct = DS('dsIndexFocus.get', 0);
				?> 
				<div style="background: url(<?php echo F('fix_url', ($ct['bg_pic']? $ct['bg_pic']: 'img/ad/ad_pic.png'));?>) no-repeat scroll 0% 0% transparent;" class="ad-pic" id="focus_index">
					<div class="ad-pic-con">
						<h3><?php echo F('escape', $ct['title']);?></h3>
						<p><?php echo F('escape', $ct['text']);?></p>
					</div>
					<a title="<?php LO('template__titleTip__click__close');?>" href="#" rel="e:cls,cn:fc_ad" class="ico-close-btn"></a>
					<a class="ad-pic-btn" rel="e:do,op:<?php echo $ct['oper'];?>,tp:<?php echo $ct['topic'];?>,ln:<?php echo urlencode($ct['link']);?>" href="#"><?php echo F('escape', $ct['btnTitle']);?></a>
				</div>
				<?php
						};
				?>
				<?php
				$param = array('list' => $list,
					'limit'=>$limit, 
					'not_found_msg' => L('index__default__notFoundTip', URL('index')),
					'list_title'=> L('index__default__listTitle'),
					'filter_type'=>$filter_type);
				Xpipe::pagelet('weibo.weiboList', $param );
				?>

				<?php endif;?>
				<!-- 微博列表 结束-->
                            </div>
                        </div>
						<div class="aside">
							<!-- 右边推荐关注-->
							<div class="mod-aside">							
								
								<?php
									if (isset($comWeibos) && is_array($comWeibos) && !empty($comWeibos)) {
								?>
								<div class="gt-commend-btn"><a href="#"  id="btnOK" class="btn-s2"><span>一键关注</span></a></div>
								<div class="hd"><h3>推荐关注</h3></div>
								<div id="chklist">
									<?php foreach ($comWeibos as $comWeibo) {?>
									<div>
									<input class="gt-commend-chk" name="gtcheckbox" checked="true" type="checkbox" value="<?php echo $comWeibo['uid'];?>"/><span class="gt-commend-name"><a href="/index.php?m=ta&id=<?php echo $comWeibo['uid'];?>"><?php echo $comWeibo['nickname'];?></a></span>
									</div>
									<?php }?>
								</div>
								<?php }else{?>
									<div class="gt-commend-btn"><a href="#"  id="btnOK" class="btn-s2 btn-s2gt"><span>一键关注</span></a></div>
									<div class="hd"><h3>匹配关注</h3></div>
									<div id="chklist">
										暂无匹配推荐
									</div>
								<?php }?>
								</div>
							
							<script type="text/javascript">
							  $("#chkbtn").click(function(){
								         
								  $("[name='gtcheckbox']").attr("checked",'true');//全选
							       
							    });

							  $("#btnOK").click(function(){
								  var ids = [];
								  var s='';
								  $('input[name="gtcheckbox"]:checked').each(function(){
								      s+=$(this).val()+',';
								      ids.push($(this).val());
								  });
								  
								  if(!ids.length){
									  Xwb.ui.MsgBox.tipWarn('请选择您要关注的折扣微博。' );
	                                }else {
	                                	Xwb.request.follow(ids.join(','), 0, function(r){
	                                        if (r.isOk()) {
		                                        Xwb.ui.MsgBox.tipOk('成功关注折扣微博');
	                                        } else {
	                                        	Xwb.ui.MsgBox.tipWarn(r.getMsg());
	                                        }
	                                    });
	                                }           
							       
							    });
							
							</script>
							<!-- 右边推荐关注结束-->
						
							<!-- 热门话题开始-->
							<div class="mod-aside top10">
    <div class="hd"><h3>热门话题</h3></div>
    <div class="bd">
        <ul>
    
        <?php
            $count  = 1;
            if (!empty($hotTopic)) 
            {
                foreach ($hotTopic as $row) 
                {
                    $topic 	= F('escape', $row['title']);
                    //$url 	= URL('search.weibo', array('base_app' => $base_app, 'k' => isset($row['query']) ? $row['query']: $row['topic']));
					$url = $row['url'];
        ?>
                     <li>
                        <div class="ranking<?php if ($count < 4):?> r-<?php echo $count;?><?php endif;?> skin-bg"><?php echo $count;?></div>
                        <a href="<?php echo $url;?>"><?php echo $topic;?></a>
                    </li>
        <?php 
                $count++;
                }
            }
        ?>
        </ul>
    </div>
</div>
<!-- 热门话题结束-->
	<?php Xpipe::pagelet('common.sideComponents', array('type'=>2) );?>
							
						</div>
					</div>
				</div>
			</div>
			<!-- 尾部 开始 -->
			<?php TPL::module('footer');?>
			<!-- 尾部 结束 -->
		</div>
	</div>
	<?php TPL::module('gotop');?>
</body>
</html>
<!-- report -->
<img src="<?php echo F('report');?>" class="hidden"/>
